<% layout('/layouts/default.html', {title: '商品详情', libs: ['validate','fileupload']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text('商品详情')}
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${natatoriumGoods}" action="${ctx}/natatoriumgoods/natatoriumGoods/save" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="form-unit">${text('基本信息')}</div>
				<#form:hidden path="id"/>
				<#form:hidden path="natatoriumInfoId"/>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								${text('商品名称')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<span>${natatoriumGoods.name}</span>							
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								${text('商品类型')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<span>${natatoriumGoods.goodsType == 1 ? '游泳票':'培训课程'}</span>							
							</div>
						</div>
					</div>
				</div>
				<div class="row" id="course">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								${text('课程人数')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<span>${natatoriumGoods.courseNumber}</span>								
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								${text('课程开始时间')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<span>${natatoriumGoods.courseStartTime, dateFormat="yyyy-MM-dd"}</span>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								${text('课程结束时间')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<span>${natatoriumGoods.courseEndTime, dateFormat="yyyy-MM-dd"}</span>
							</div>
						</div>
					</div>										
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								${text('价格')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<span>${natatoriumGoods.price}</span>									
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								${text('使用截至时间')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<span>${natatoriumGoods.useFinishTime, dateFormat="yyyy-MM-dd"}</span>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								${text('商品状态')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<span>${natatoriumGoods.goodsStatus == 1 ? '已下架':'上架中'}</span>								
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								${text('库存数量')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<span>${natatoriumGoods.number}</span>								
							</div>
						</div>
					</div>				
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								${text('商品内容')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<span>${natatoriumGoods.content}</span>								
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2">${text('商品图片')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:fileupload id="uploadImage" bizKey="${natatoriumGoods.id}" bizType="natatoriumGoods_image"
									uploadType="image" class="required" readonly="true"/>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
$(document).ready(function() {
	var goodsType = '${natatoriumGoods.goodsType}';
	if(goodsType == 1){
		$('#course').hide();
	}
})

</script>